CXXFLAGS =	-march=native -O2 -g -std=gnu++0x  
CFLAGS = $(CXXFLAGS) 

DEFS_ERROR = -DERROR
DEFS    = -DTRACE $(DEFS_ERROR)

##  svn checkout http://leveldb.googlecode.com/svn/trunk/ leveldb-read-only
## make 
## Path del directorio del leveldb 
#LEVELDB = /home/cristian/levelDB/leveldb-read-only
INCDIR  = ./include
INCDIR2 = ./include/stem
LDFLAGS	= 
DESTDIR	= ../bin/hal
#LIBS	=  -lpthread  
#LIBS	=  -L$(LEVELDB) -Ltinyxml -lleveldb -lpthread
LIBS	=  -ltinyxml -lpthread 

OBJ	= Hal.o Logger.o HalThread.o WorkerSpace.o HalSocket.o Socket.o HttpHeader.o

all: hal

hal: $(OBJ)
	@echo
	@echo "Compiling Hal"
	@echo "================"
	$(CXX) $(CXXFLAGS)  $(DEFS_CORE) $(DEFS) -I$(INCDIR) -I$(INCDIR2)  -o $@ $(OBJ) $(LIBS)
.cpp.o:
	$(CXX) -c $(CFLAGS)  $(DEFS_CORE) $(DEFS) -I$(INCDIR) -I$(INCDIR2)  $< $(LIBS)

clean:
	rm -rf *.o
	rm -rf ../bin/hal
	rm -rf hal